<template>
  <div class="item">
    <img :src="'https://elm.cangdu.org/img/' + item.image_path" alt="" />
    <!-- 如果后台给的图片地址是一个相对路径需要在前面加上基本路径 再加上一个 img文件夹或者 image文件夹 -->
    <h5>{{ item.name }}</h5>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
export default {
  props: { item: Object },
  setup(props, ctx) {
    const store = useStore();
    const router = useRouter();
    const route = useRoute();
    const data = reactive({});
    return { ...toRefs(data) };
  },
};
</script>

<style lang="scss" scoped>
.item {
  height: 60px;
  border: 1px solid #ccc;
  display: flex;
  img {
    width: 50px;
    height: 50px;
  }
}
</style>
